package com.sui.bigdata.flink.sql.function.aggregate;

import com.sui.bigdata.flink.sql.function.util.Count;

import org.apache.flink.table.functions.AggregateFunction;

public  class TestSum extends AggregateFunction<Integer, Count> {

    @Override
    public Count createAccumulator() {
        return new Count();
    }

    @Override
    public Integer getValue(Count count) {

        return count.getCount();
    }

    public void accumulate(Count count, Integer num,Integer add) {

         count.setCount(count.getCount()+num+add);
    }


}
